<?
$mysqli = new mysqli("localhost", "uzytkownik", "haslo", "nazwa_bazy_danych");
if (mysqli_connect_errno()) {
   echo("Nawizanie poczenia zakoczyo si niepowodzeniem, komunikat bdu brzmi: ".
      mysqli_connect_error());
   exit();
}
$stmt = $mysqli->prepare("select image from images where id=?");
$stmt->bind_param("i",$id);
$id = $_GET['id'];
$stmt->execute();
$image=NULL;
$stmt->bind_result($image);
$stmt->fetch();
header("Content-type: image/jpeg");
echo $image;
?>
